<?php
namespace app\index\controller\traits;

trait User
{

/**
 * 角色ID查询
 */
    function getUserId($id, $nickname)
    {

        $model = new \app\index\model\DCharacter();
        $res   = $model->field("`id`,`nickname`")
            ->where("`id`='{$id}' OR `nickname`='{$nickname}'")
            ->find();

        return ($res ? $res->getData('id') : null);
    }

}
